package com.example.demomk.ViewModel;

import static com.example.demomk.db.AppDatabase.databaseWriteExecutor;

import android.app.Application;
import android.content.Context;
import android.graphics.Typeface;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;

import com.example.demomk.Repository.printRepository;
import com.example.demomk.Utils.StdDialogData;
import com.example.demomk.entity.LocationStats;
import com.example.demomk.entity.SizeStats;

import java.util.List;

public class PrintViewModel extends AndroidViewModel {
    private final printRepository repository;

    public PrintViewModel(@NonNull Application application) {
        super(application);
        repository = new printRepository(application);
    }

    public void generatePDF(Context context, String title, int avgId, printRepository.OnPDFGeneratedListener listener, Typeface font, StdDialogData data, List<SizeStats> sizeStats,List<LocationStats> locationStats) {
        databaseWriteExecutor.execute(() -> repository.generatePDF(context, title, avgId, listener, font, data, sizeStats,  locationStats));
    }


}
